package com.study.yygh.hosp.controller;

import com.study.yygh.common.result.Result;
import com.study.yygh.hosp.service.DepartmentService;
import com.study.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author tao
 * @create 2021-09-30 19:44
 * @Description
 */
@RestController
@RequestMapping("admin/hosp/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    // 根据医院编号 查询医院所有科室列表
    @ApiOperation(value = "查询医院所有科室列表")
    @GetMapping("getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode){
        List<DepartmentVo> deptTree = departmentService.findDeptTree(hoscode);
        return  Result.ok(deptTree);
    }
}
